//
//  CouponMerchantResponse.m
//  EasyToo
//
//  Created by zhengzhe on 13-11-18.
//
//

#import "CouponMerchantResponse.h"
#import "Merchant.h"

@implementation CouponMerchantResponse

- (void)parse
{
    [super parse];
    
    if (self.bodyDict)
    {
        self.merchantArray = [[NSMutableArray alloc] init];
        
        NSArray *JsonArray = GetDictionaryArrayDefaultNil(self.bodyDict, @"merchants");
        for (int i = 0; i < [JsonArray count]; i++)
        {
            NSDictionary *jsonDict = [JsonArray objectAtIndex:i];
            Merchant *merchant = [[Merchant alloc] initWithDictionary:jsonDict];
            [self.merchantArray addObject:merchant];
            
            [merchant release];
        }
    }
    
}

- (void)dealloc
{
    self.merchantArray = nil;
    [super dealloc];
}

@end
